from django.shortcuts import render, HttpResponse
from .models import Qichachadb as Qcc
# Create your views here.
import json


def index(request):
    return render(request, 'index01.html')


def index_logic(request):
    keywords = request.GET.get('words', '')
    # print(keywords)
    serach_content = Qcc.objects.filter(title__contains=keywords)
    content = {}
    content['search_words'] = keywords
    content['serach_content'] = serach_content
    # print(content)

    return render(request, 'search.html', content)
